package com.pfzy.utildemo.activity.mqtt;

import android.os.Bundle;
import android.view.View;

import com.pfzy.utildemo.R;
import com.pfzy.utildemo.activity.base.BaseActivity;
import com.pfzy.utildemo.databinding.ActivityMqttBinding;

public class MqttActivity extends BaseActivity implements View.OnClickListener {
    private ActivityMqttBinding mBind;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        mBind = ActivityMqttBinding.inflate(getLayoutInflater());
        setContentView(mBind.getRoot());
        initView();
    }

    private void initView() {
        mBind.start.setOnClickListener(this);
        mBind.stop.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.start:
                MQService.actionStart(this);
                break;
            case R.id.stop:
                MQService.actionStop(this);
                break;
            default:
                break;
        }
    }
}
